#pragma once

#include <vector>
#include <string>

#include <pthread.h>

class TConnectionManager;
class TConnectionHandler;

class THandlerPool {
public:
    typedef std::vector<TConnectionHandler*>    THandlers;
    typedef std::vector<pthread_t*>             TThreads;

    THandlerPool()
    : Handlers(0, NULL)
    , Threads(0, NULL)
    {}

    bool Init( unsigned int poolSize
             , TConnectionManager& connections
             , const std::string& path
             , unsigned int ioBufferSize );

    void Stop();

    ~THandlerPool();

private:
    THandlers   Handlers;
    TThreads    Threads;
};
